package com.example.langchanin4jdemo1.controller;

import dev.langchain4j.community.model.dashscope.QwenChatModel;
import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.service.AiServices;
import dev.langchain4j.service.SystemMessage;

public class AIServiceDemo {
    interface AiWriter {
        String write(String message);
    }
    public static void main(String[] args) {
        ChatLanguageModel model = QwenChatModel.builder()
                .apiKey("sk-875dd6ef14244431acdc7ccb974f5bfe")
                .modelName("deepseek-r1")
                .build();
        AiWriter writer = AiServices.create(AiWriter.class, model);
        String response = writer.write("谁是这个世界上对你最重要的人");
        System.out.println(response);

    }
}
